﻿<sap:ActivityDesigner x:Class="Demo.WF4.Designers.ActivityDesignerWithActivities1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation">
    <sap:ActivityDesigner.Resources>
        <!-- Style des Border -->
        <Style x:Key="BorderStyle" TargetType="{x:Type Border}">
            <Style.Setters>
                <Setter Property="BorderBrush" Value="#D7D7E2" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Background" Value="White" />
                <Setter Property="Padding" Value="5" />
            </Style.Setters>
        </Style>

        <!-- WorkflowItemsPresenter -->
        <Style TargetType="{x:Type sap:WorkflowItemsPresenter}">
            <Style.Setters>
                <Setter Property="HintText" Value="Drop activities here" />
                <Setter Property="ItemsPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical" />
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="SpacerTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel>
                                <Polygon HorizontalAlignment="Center" Margin="5" Fill="White" Stroke="#A8B3C2" Points="0,0 16,0 8,8" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type sap:WorkflowItemsPresenter}">
                            <Border Style="{StaticResource ResourceKey=BorderStyle}">
                                <ContentPresenter />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style>
    </sap:ActivityDesigner.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Content="Activities" />
        <sap:WorkflowItemsPresenter Grid.Row="1" Items="{Binding Path=ModelItem.Activities}"/>
    </Grid>
</sap:ActivityDesigner>
